<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>配置信息</title>
		<script type="text/javascript">
	$(function() {
		$("#single").validate(); //为inputForm注册validate函数
		$("#multiple").validate(); //为inputForm注册validate函数
	});
	
	$(document).ready(function() { 
	    $("#single").ajaxForm(function(data) {  
	       $("#content").html("增加成功");
	       $("#message").show();
	    });
	     $("#multiple").ajaxForm(function(data) {  
	       $("#content").html("增加成功");
	       $("#message").show();
	    });
	    
	     $("#forward").ajaxForm(function(data) {  
	       $("#content").html("增加成功");
	       $("#message").show();
	    });
	});
	
	 function local(item){
		        window.location.href="${ctx}/taskNumber/init/"+item.value;
		     }
</script>
	</head>

	<body>
	<div id="message" class="alert alert-success" style="display: none;">
			<span id="content"></span>
		</div>
		<div class="span12">
		     	<b>客户名称:</b>
				
				<select class="input-medium" id="customers" onchange="local(this);">
					<c:forEach items="${customers }" var="o">
						<option value="${o.customerCode}" <c:if test="${customerCode eq  o.customerCode}">selected</c:if>> ${o.customerName } </option>
					</c:forEach>
				</select>
		</div>
		<c:if test="${status eq 0 }">
			<script type="text/javascript">
		    
		     window.location.href="${ctx}/taskNumber/init/"+$("#customers").val();
		   </script>
		</c:if>
	
		<div class="span12">
			<div class="span4">
				<form method="post" id="single" class="form-search"
					action="${ctx }/taskNumber/create">
					<h3>
						单件配置
					</h3>
					<fieldset>
						<input value="single" type="hidden" name="type" />
						<div>
							<lable>
							批次数量设置:
							</lable>
							<input type="text" value="${single.batchTaskNumber }"
								name="batchTaskNumber" class="input-large required" />
						</div>
						<div>
							<lable>
							任务数量设置:
							</lable>
							<input type="text" value="${single.backupTaskNumber }"
								name="backupTaskNumber" class="input-large required" />
						</div>

						<input type="submit" value="提交" class="btn" />
					</fieldset>
				</form>
			</div>
			<div class="span4">
				<form method="post" id="multiple" class="form-search" action="${ctx }/taskNumber/create">
					<h3>
						多件配置
					</h3>
					<fieldset>
						<input value="multiple" type="hidden" name="type" />
						<div>
							<lable>
							批次数量设置:
							</lable>
							<input type="text" value="${multiple.batchTaskNumber }"
								name="batchTaskNumber" class="input-large required" />
						</div>
						<div>
							<lable>
							任务数量设置:
							</lable>
							<input type="text" value="${multiple.backupTaskNumber }"
								name="backupTaskNumber" class="input-large required" />
						</div>
						<input type="submit" value="提交" class="btn" />
					</fieldset>
				</form>
			</div>
				<div class="span4">
				<form method="post" id="forward" class="form-search" action="${ctx }/taskNumber/create">
					<h3>
						中转发配置
					</h3>
					<fieldset>
						<input value="forward" type="hidden" name="type" />
						<div>
							<lable>
							批次数量设置:
							</lable>
							<input type="text" value="${forward.batchTaskNumber }"
								name="batchTaskNumber" class="input-large required" />
						</div>
						<div>
							<lable>
							任务数量设置:
							</lable>
							<input type="text" value="${forward.backupTaskNumber }"
								name="backupTaskNumber" class="input-large required" />
						</div>
						<input type="submit" value="提交" class="btn" />
					</fieldset>
				</form>
			</div>
		</div>
	</body>
</html>
